﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    [Serializable]
    [DataContract]
    public class JuZhuanAnZhiJiHuaEmpModel
    {
        private bool isselected = false;
        [DataMember]
        public bool IsSelected
        {
            get { return isselected; }
            set { isselected = value; }
        }
        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        private int _Sec;
        [DataMember]
        public int Sec
        {
            get { return _Sec; }
            set { _Sec = value; }
        }
        private int _JiHuaID;
        [DataMember]
        public int JiHuaID
        {
            get { return _JiHuaID; }
            set { _JiHuaID = value; }
        }
        private string _Name;
        [DataMember]
        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }
        private string _CardNo;
        [DataMember]
        public string CardNo
        {
            get { return _CardNo; }
            set { _CardNo = value; }
        }
        private string _Gender;
        [DataMember]
        public string Gender
        {
            get { return _Gender; }
            set { _Gender = value; }
        }
        private string _XueLi;
        [DataMember]
        public string XueLi
        {
            get { return _XueLi; }
            set { _XueLi = value; }
        }
        private string _ZhengZhiMianMao;
        [DataMember]
        public string ZhengZhiMianMao
        {
            get { return _ZhengZhiMianMao; }
            set { _ZhengZhiMianMao = value; }
        }
        private string _YuanDanWeiZhiWu;
        [DataMember]
        public string YuanDanWeiZhiWu
        {
            get { return _YuanDanWeiZhiWu; }
            set { _YuanDanWeiZhiWu = value; }
        }
        private string _QiTaDanWei;
        [DataMember]
        public string QiTaDanWei
        {
            get { return _QiTaDanWei; }
            set { _QiTaDanWei = value; }
        }
        private string _ZhiWuCengCi;
        [DataMember]
        public string ZhiWuCengCi
        {
            get { return _ZhiWuCengCi; }
            set { _ZhiWuCengCi = value; }
        }
        private string _ZhiWuShuXing;
        [DataMember]
        public string ZhiWuShuXing
        {
            get { return _ZhiWuShuXing; }
            set { _ZhiWuShuXing = value; }
        }


        private DateTime? _Birthday;
        [DataMember]
        public DateTime? Birthday
        {
            get { return _Birthday; }
            set { _Birthday = value; }
        }
        private int _AnZhiDanWei;
        [DataMember]
        public int AnZhiDanWei
        {
            get { return _AnZhiDanWei; }
            set { _AnZhiDanWei = value; }
        }
        private int _Status;
        [DataMember]
        public int Status
        {
            get { return _Status; }
            set { _Status = value; }
        }
        private DateTime? _AnZhiShiJian;
        [DataMember]
        public DateTime? AnZhiShiJian
        {
            get { return _AnZhiShiJian; }
            set { _AnZhiShiJian = value; }
        }
        private string _OrgName;
        [DataMember]
        public string OrgName
        {
            get { return _OrgName; }
            set { _OrgName = value; }
        }
        private string _StatusString;
        [DataMember]
        public string StatusString
        {
            get { return _StatusString; }
            set { _StatusString = value; }
        }
        public static JuZhuanAnZhiJiHuaEmpModel FillEntity(DataRow dr)
        {
            JuZhuanAnZhiJiHuaEmpModel right = new JuZhuanAnZhiJiHuaEmpModel();
            if (dr.Table != null && dr.Table.Columns.Contains("Sec")) right.Sec = Convert.ToInt32(dr["Sec"]);
            right.ID = Convert.ToInt32(dr["ID"]);
            if (!string.IsNullOrEmpty(dr["JiHuaID"].ToString())) right.JiHuaID = Convert.ToInt32(dr["JiHuaID"]);
            if (!string.IsNullOrEmpty(dr["Name"].ToString())) right.Name = dr["Name"].ToString();
            if (!string.IsNullOrEmpty(dr["CardNo"].ToString())) right.CardNo = dr["CardNo"].ToString();
            if (!string.IsNullOrEmpty(dr["Gender"].ToString())) right.Gender = dr["Gender"].ToString();
            if (!string.IsNullOrEmpty(dr["XueLi"].ToString())) right.XueLi = dr["XueLi"].ToString();
            if (!string.IsNullOrEmpty(dr["ZhengZhiMianMao"].ToString())) right.ZhengZhiMianMao = dr["ZhengZhiMianMao"].ToString();
            if (!string.IsNullOrEmpty(dr["YuanDanWeiZhiWu"].ToString())) right.YuanDanWeiZhiWu = dr["YuanDanWeiZhiWu"].ToString();
            if (!string.IsNullOrEmpty(dr["QiTaDanWei"].ToString())) right.QiTaDanWei = dr["QiTaDanWei"].ToString();
            if (!string.IsNullOrEmpty(dr["ZhiWuCengCi"].ToString())) right.ZhiWuCengCi = dr["ZhiWuCengCi"].ToString();
            if (!string.IsNullOrEmpty(dr["ZhiWuShuXing"].ToString())) right.ZhiWuShuXing = dr["ZhiWuShuXing"].ToString();
            if (!string.IsNullOrEmpty(dr["OrgName"].ToString())) right.OrgName = dr["OrgName"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("AnZhiDanWei")) if (!string.IsNullOrEmpty(dr["AnZhiDanWei"].ToString())) right.AnZhiDanWei = Convert.ToInt32(dr["AnZhiDanWei"]);
            if (!string.IsNullOrEmpty(dr["Status"].ToString()))
            {
                right.Status = Convert.ToInt32(dr["Status"]);
                if (right.Status == 0) right.StatusString = "未报到";
                else right.StatusString = "已安置";
            }
            if (!string.IsNullOrEmpty(dr["Birthday"].ToString()) && Convert.ToDateTime("1900-01-01") != Convert.ToDateTime(dr["Birthday"])) right.Birthday = Convert.ToDateTime(dr["Birthday"]);
            if (!string.IsNullOrEmpty(dr["AnZhiShiJian"].ToString()) && Convert.ToDateTime("1900-01-01") != Convert.ToDateTime(dr["AnZhiShiJian"])) 
                right.AnZhiShiJian = Convert.ToDateTime(dr["AnZhiShiJian"]);
            return right;
        }
    }
}
